var rUserEnpointURL = host_url + '/UserService/';
var rPrivilegeEnpointURL = host_url +'/PrivilegeService/';
app.factory("rUser", function ($resource) {
	return $resource(rUserEnpointURL + ":id/:username", 
			{id:'@id', username:'@username'},
			{
				get: {
					method: 'GET',
					isArray:  "true"
				},
				getByUsername: {
					method: 'GET',
					url:  rUserEnpointURL + "username/:username"
				},
				getLoggedUser: {
					method: 'GET',
					url:  rUserEnpointURL + "getLoggedUser"
				},
				getPrivilegesOfLoggedUser: {
					method: 'GET',
					url: rUserEnpointURL + "getPrivilegesOfLoggedUser"
				},
				getBusinessProcesses: {
					method: 'GET',
					url: rUserEnpointURL + "getBusinessProcessesOfLoggedUser",
					isArray:  "true"
				}
			});
});

app.factory("rPrivilege", function ($resource) {
	return $resource(rPrivilegeEnpointURL + ":id", 
			{id:'@id'},
			{
				get: {
					method: 'GET',
					isArray:  "true"
				}
			});
});

var rApartmentServiceEnpointURL = host_url + '/apartmentService/';
app.factory("rApartment", function ($resource) {
	return $resource(rApartmentServiceEnpointURL, {},
			{
				get: {
					method: 'GET',
					url: rApartmentServiceEnpointURL + "getApartmentInfo",
				}
			});
});